package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.OpportunityFocusEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author long.rao
 * @version v1.0
 * @date 2019/2/1 10:30
 * @since v1.0
 */
@Repository
@Mapper
public interface OpportunityFocusDao {
    /**
     * 插入数据
     *
     * @param opportunityFocusEntity 关注员工实体数据
     * @return java.lang.Integer
     * @author long.rao
     * @date 2019-02-01 11:05
     */
    Integer insert(OpportunityFocusEntity opportunityFocusEntity);
    /**
     * 更新数据
     *
     * @param opportunityFocusEntity 关注员工实体数据
     * @return java.lang.Integer
     * @author long.rao
     * @date 2019-02-01 11:05
     */
    Integer update(OpportunityFocusEntity opportunityFocusEntity);
    /**
     * 根据id查询数据
     *
     * @param key 主键
     * @param corpid 公司ID
     * @return com.xbongbong.saas.domain.entity.OpportunityFocusEntity
     * @author long.rao
     * @date 2019-02-01 11:05
     */
    OpportunityFocusEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    List<Long> getShareOpportunityIdList(@Param("corpid") String corpid);

    List<Long> getNoShareOpportunityIdList(@Param("userId") String userId, @Param("corpid") String corpid);

    OpportunityFocusEntity getByOpportunityId(@Param("opportunityId") Long dataId, @Param("userId") String userId, @Param("corpid") String corpid);

    void unFocusBatch(@Param("opportunityId") Long dataId, @Param("corpid") String corpid);
    /**
     * 多条查询
     * @param param 参数
     * @return java.lang.Integer
     * @author long.rao
     * @date 2019-02-01 15:18
     */
    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    List<OpportunityFocusEntity> findEntitys(@Param("param") Map<String,Object> param);
}
